<!doctype html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>人力资源管理系统</title>
	<link rel="stylesheet" type="text/css" href="css/login.css">
	<script type="text/javascript" src="js/login.js"></script>
	<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
	<div class="maxbox" style="padding-top:100px">
		<div class="login-wrap">
			<div class="login-html">
				<input id="tab-1" type="radio" name="tab" class="sign-in" checked><label for="tab-1" class="tab">登录</label>
				<input id="tab-2" type="radio" name="tab" class="sign-up"><label for="tab-2" class="tab">注册</label>
				<div class="login-form">
					<form id="from-reg" action="/user/CheckUser" method="post">
						<div class="sign-in-htm">
						<div class="group">
							<label for="user" class="label">账号</label>
							<input id="user" type="text" class="input" placeholder="请输入账号" name="uID">
						</div>
						<div class="group">
							<label for="pass" class="label">密码</label>
							<input id="pass" type="password" class="input" data-type="password" placeholder="请输入密码" name="UPassword">
						</div>
						<div class="group">
							<label class="tab-yzm" onclick="yzm_onload()" id="yzm_in">验证码</label>
							<input type="text" name="yzm" id="yzm" placeholder="请输入验证码" />
						</div>
						<div class="group">
							<input type="button" class="button" value="登录"  id="sign_in">
						</div>
						<div class="hr"></div>
						<div class="foot-lnk">
							<a href="#forgot"></a>
						</div>
					</div>
					</form>
					<div class="sign-up-htm">
						<div class="group">
							<label for="su_user" class="label">名字</label>
							<input id="su_user" type="text" class="input">
						</div>
						<div class="group">
							<label for="su_pass1" class="label">密码</label>
							<input id="su_pass1" type="password" class="input" data-type="password">
						</div>
						<div class="group">
							<label for="su_pass2" class="label">再次输入密码</label>
							<input id="su_pass2" type="password" class="input" data-type="password">
						</div>
						
						<div class="group">
							<input type="submit" class="button" value="注册" onclick="zc_onclick()" id="sign_up">
						</div>
						<div class="hr"></div>
						
					</div>
				</div>
			</div>
		</div>
	</div>
	<div>
	</div>
		<script type="text/javascript">
		yzm_onload();
		 $("#sign_in").click(function (){
			 $.ajax({
				 url:"/user/CheckUser",
				 type:"post",
				 data:$("#from-reg").serialize(),
				 dataType:"JSON",
				 success:function (json){
					 if(json.status==200){
						 alert(json.data)
						 if(json.data=="普通用户")
						 location.href="/comment/index.html";
						 else if(json.data=="系统管理员")
							 location.href="/system/index.html"
						 else if(json.data=="人事经理")
							 location.href="/emfh/index.html";
						 else if(json.data=="人事专员")
							 location.href="/emset/index.html";
						 else if(json.data=="薪酬经理")
							 location.href="/memoyfh/index.html";
						 else if(json.data=="薪酬专员")
							 location.href="/memoyset/index.html";
					 }else{
						 alert(json.data);
						 yzm_onload();
					 }
				 },
				 error:function (){
						alert("未知错误");
				 }
			 })
		 })
	</script>
</body>
</html>